{extend name="template/base" /}
{block name="nav"}{/block}
{block name="content"}
<div class="page-container">
    <form class="form form-horizontal" id="form" method="post" action="{:\\think\\Url::build('billing')}">
        <input type="hidden" name="id" value="{$vo.id ?? ''}">
        <input type="hidden" name="id" value="{$vo.id ?? ''}">
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">订单编号：</label>
            <div class="formControls col-xs-6 col-sm-6">
                {$order.number??''}
            </div>
            <div class="col-xs-3 col-sm-3">{$order.unit_sum??0}件商品，共计{$order.total_fee??0}</div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">商品列表：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <table class="table table-border">
                    <tbody>
                    {volist name="$order.goods" id="goods" key="k"}
                    <tr>
                        <td>{$k??''}</td>
                        <td>
                            <img src="">
                        </td>
                        <td>{$goods.name}</td>
                        <td>x{$goods.sum}</td>
                        <td>￥{$goods.price*$goods.sum}</td>
                    </tr>
                    {/volist}
                    </tbody>
                </table>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">发票详情：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <table class="table">
                    <tr>
                        <td>发票抬头：</td>
                        <td>{$vo.title}</td>
                    </tr>
                    <tr>
                        <td>发票种类：</td>
                        <td>
                            {if condition="$vo.class == 'common'"}
                            <span>增值税普通发票</span>
                            {else/}
                            <span>增值税专用发票</span>
                            {/if}
                        </td>
                    </tr>
                    <tr>
                        <td>发票类型：</td>
                        <td>
                            {if condition="$vo.type == 'personal'"}
                            <span>个人</span>
                            {elseif condition="$vo.type == 'company'"}
                            <span>企业</span>
                            {else/}
                            <span>事业政府</span>
                            {/if}
                        </td>
                    </tr>

                    <tr>
                        <td>税号：</td>
                        <td>{$vo.code}</td>
                    </tr>
                    <tr>
                        <td>开户行名称：</td>
                        <td>{$vo.bank_name}</td>
                    </tr>
                    <tr>
                        <td>银行卡号：</td>
                        <td>{$vo.bank_card}</td>
                    </tr>
                    <tr>
                        <td>注册地址：</td>
                        <td>{$vo.address}</td>
                    </tr>
                    <tr>
                        <td>注册电话：</td>
                        <td>{$vo.phone}</td>
                    </tr>
                    <tr>
                        <td>寄送类型：</td>
                        <td>
                            {if condition="$vo.get_type == 'post'"}
                            <span>邮寄</span>
                            {else if condition="$vo.get_type == 'email'"}
                            <span>电子发票</span>
                            {/else}
                            <span>自取</span>
                            {/if}</td>
                    </tr>
                    <tr>
                        <td>邮寄人：</td>
                        <td>{$vo.post_name}</td>
                    </tr>
                    <tr>
                        <td>邮寄电话：</td>
                        <td>{$vo.post_phone}</td>
                    </tr>
                    <tr>
                        <td>邮寄地址：</td>
                        <td>{$vo.post_address}</td>
                    </tr>
                    <tr>
                        <td>邮寄邮箱：</td>
                        <td>{$vo.post_email}</td>
                    </tr>

                </table>
            </div>

        </div>

        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3" style="display: inline;padding-top: 10px;">请在开票系统开票，如已开票请点击<span class="c-red">确认已开票</span>反馈给用户！</label>
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                {if condition='$vo.state == "pending"'}
                <button type="button" onclick="billing(this)" class="btn btn-primary radius">&nbsp;&nbsp;确认已开票&nbsp;&nbsp;</button>
                {else/}
                <label class="label label-default">已开票</label>
                {/if}
                <button type="button" class="btn btn-default radius ml-20" onClick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
        </div>
    </form>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>
<script>
    $(function () {
        $("[name='status'][value='{$vo.status ?? '1'}']").attr("checked",true);

        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        $("#form").Validform({
            tiptype:2,
            ajaxPost:true,
            showAllError:true,
            callback:function(ret){
                ajax_progress(ret);
                //layer_close();
            }
        });
    })
    function billing(obj) {
        layer.alert('您确定已开票了？', {
            btn: ['确定', '取消'] //按钮
        }, function (i) {
            $(obj).submit();
            layer.close(i);
        });
    }


</script>


{/block}